<template>
    
  <div>
    <HeaderNav />
    <router-view></router-view>

    <form action="/" class="sousuo">
      <van-search
        v-model="value"
        show-action
        padding-left="15px"
        placeholder="搜电影、搜影院"
        @search="onSearch"
        @cancel="onCancel"
      />
    </form>
  </div>
</template>

<script>

import Vue from "vue";
// import { Search } from "vant";
// Vue.use(Search);

// import { Toast } from "vant";

import HeaderNav from "../../components/HeaderNav";

export default {
  data() {
    return {
      value: "",
    };
  },
  //事件总线：底部隐藏
   created() {
    this.$eventBus.$emit("hideMenu", false);
  },

  mounted() {},
  components: {
    HeaderNav,
  },
  methods: {
    onSearch(val) {
      Toast(val);
    },
    onCancel() {
      this.$router.go(-1)
    },
  },
    beforeDestroy() {
    this.$eventBus.$emit("hideMenu", true);
  },
};
</script>
<style lang='scss' scoped>
div{
  .sousuo{
    width: 100%;
  }
  .van-search--show-action{
    width: 375px;
    margin-top: 0
  }
  .van-search__action{
     color: red;
     font-size: 15px;
  }
  .van-search__content{
    border-radius: 5px
  }
};
</style>
